import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView
  },
  {
    path: '/about',
    name: 'about',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
  },
  {
    path: '/search',
    name: 'search',
    component: () => import(/* webpackChunkName: "search" */ '../views/SearchView.vue')
  },
  {
    path: '/choose',
    name: 'choose',
    component: () => import(/* webpackChunkName: "choose" */ '../views/ChooseView.vue')
  },
  {
    path: '/classify',
    name: 'classify',
    component: () => import(/* webpackChunkName: "classify" */ '../views/ClassifyView.vue')
  },
  {
    path: '/result',
    name: 'result',
    component: () => import(/* webpackChunkName: "result" */ '../views/ResultView.vue')
  },
  {
    path: '/bacteria',
    name: 'bacteria',
    component: () => import(/* webpackChunkName: "bacteria" */ '../views/BacteriaView.vue')
  },
  {
    path: '/bacterias',
    name: 'bacterias',
    component: () => import(/* webpackChunkName: "bacterias" */ '../views/BacteriasView.vue')
  },
  {
    path: '/health',
    name: 'health',
    component: () => import(/* webpackChunkName: "health" */ '../views/HealthView.vue')
  },
  {
    path: '/cancer',
    name: 'cancer',
    component: () => import(/* webpackChunkName: "cancer" */ '../views/CancerView.vue')
  },
  {
    path: '/nocancer',
    name: 'nocancer',
    component: () => import(/* webpackChunkName: "nocancer" */ '../views/NoCancerView.vue')
  },
  // {
  //   path: '/nacigation',
  //   name: 'nacigation',
  //   component: () => import(/* webpackChunkName: "nacigation" */ '../views/NacigationView.vue')
  // },
  {
    path: '/aerosol',
    name: 'aerosol',
    component: () => import(/* webpackChunkName: "aerosol" */ '../views/Aerosol.vue')
  },
  {
    path: '/reaction',
    name: 'reaction',
    component: () => import(/* webpackChunkName: "reaction" */ '../views/Reaction.vue')
  },
  {
    path: '/catalytic',
    name: 'catalytic',
    component: () => import(/* webpackChunkName: "reaction" */ '../views/Catalytic.vue')
  },
  {
    path: '/pill',
    name: 'pill',
    component: () => import(/* webpackChunkName: "reaction" */ '../views/PillView.vue')
  },
  {
    path: '/coking',
    name: 'coking',
    component: () => import(/* webpackChunkName: "reaction" */ '../views/CokingView.vue')
  },
  {
    path: '/oil',
    name: 'oil',
    component: () => import(/* webpackChunkName: "reaction" */ '../views/OilView.vue')
  },
  {
    path:'/team',
    name: 'team',
    component: () => import(/*  webpackChunkName: "reaction" */ '../views/TeamView.vue')
  },
  {
    path:'/fund',
    name: 'fund',
    component: () => import(/*  webpackChunkName: "reaction" */ '../views/FundView.vue')
  },
  {
    path:'/patent',
    name: 'patent',
    component: () => import(/*  webpackChunkName: "reaction" */ '../views/PatentView.vue')
  },
  {
    path:'/paper',
    name: 'paper',
    component: () => import(/*  webpackChunkName: "reaction" */ '../views/PaperView.vue')
  },
  {
    path:'/serachIntro',
    name: 'searchIntro',
    component: () => import(/*  webpackChunkName: "reaction" */ '../views/SearchIntroView.vue')
  },
  {
    path:'/news',
    name: 'news',
    component: () => import(/*  webpackChunkName: "reaction" */ '../views/NewsView.vue')
  },
]

const router = new VueRouter({
  routes,
  // 配置跳转时候到新页面最上方
  scrollBehavior() {
      return { x: 0, y: 0 };
  }
})

export default router
